package com.letian.record.service.impl;

import java.util.List;
import com.letian.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.letian.record.mapper.RecordTimeMapper;
import com.letian.record.domain.RecordTime;
import com.letian.record.service.IRecordTimeService;

/**
 * 记录时间Service业务层处理
 * 
 * @author bmz
 * @date 2023-01-15
 */
@Service
public class RecordTimeServiceImpl implements IRecordTimeService 
{
    @Autowired
    private RecordTimeMapper recordTimeMapper;

    /**
     * 查询记录时间
     * 
     * @param timeId 记录时间主键
     * @return 记录时间
     */
    @Override
    public RecordTime selectRecordTimeByTimeId(Long timeId)
    {
        return recordTimeMapper.selectRecordTimeByTimeId(timeId);
    }

    /**
     * 查询记录时间列表
     * 
     * @param recordTime 记录时间
     * @return 记录时间
     */
    @Override
    public List<RecordTime> selectRecordTimeList(RecordTime recordTime)
    {
        return recordTimeMapper.selectRecordTimeList(recordTime);
    }

    /**
     * 查询记录时间列表
     *
     * @param recordTime 记录时间
     * @return 记录时间
     */
    @Override
    public List<RecordTime> selectRecordTimeListToday(RecordTime recordTime)
    {
        return recordTimeMapper.selectRecordTimeListToday(recordTime);
    }

    /**
     * 新增记录时间
     * 
     * @param recordTime 记录时间
     * @return 结果
     */
    @Override
    public int insertRecordTime(RecordTime recordTime)
    {
        recordTime.setCreateTime(DateUtils.getNowDate());
        return recordTimeMapper.insertRecordTime(recordTime);
    }

    /**
     * 修改记录时间
     * 
     * @param recordTime 记录时间
     * @return 结果
     */
    @Override
    public int updateRecordTime(RecordTime recordTime)
    {
        recordTime.setUpdateTime(DateUtils.getNowDate());
        return recordTimeMapper.updateRecordTime(recordTime);
    }

    /**
     * 批量删除记录时间
     * 
     * @param timeIds 需要删除的记录时间主键
     * @return 结果
     */
    @Override
    public int deleteRecordTimeByTimeIds(Long[] timeIds)
    {
        return recordTimeMapper.deleteRecordTimeByTimeIds(timeIds);
    }

    /**
     * 删除记录时间信息
     * 
     * @param timeId 记录时间主键
     * @return 结果
     */
    @Override
    public int deleteRecordTimeByTimeId(Long timeId)
    {
        return recordTimeMapper.deleteRecordTimeByTimeId(timeId);
    }
}
